3.380 \(\int \frac{1}{1+\tan ^3(x)} \, dx\)

Optimal. Leaf size=37 \[ \frac{x}{2}-\frac{1}{3} \log \left (\tan ^2(x)-\tan (x)+1\right )+\frac{1}{6} \log (\tan (x)+1)-\frac{1}{2} \log (\cos (x)) \]

[Out]

x/2 - Log[Cos[x]]/2 + Log[1 + Tan[x]]/6 - Log[1 - Tan[x] + Tan[x]^2]/3

________________________________________________________________________________________

Rubi [A]  time = 0.0612837, antiderivative size = 37, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.75, Rules used = {3661, 2074, 635, 203, 260, 628} \[ \frac{x}{2}-\frac{1}{3} \log \left (\tan ^2(x)-\tan (x)+1\right )+\frac{1}{6} \log (\tan (x)+1)-\frac{1}{2} \log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

Int[(1 + Tan[x]^3)^(-1),x]

[Out]

x/2 - Log[Cos[x]]/2 + Log[1 + Tan[x]]/6 - Log[1 - Tan[x] + Tan[x]^2]/3

Rule 3661

Int[((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x]
, x]}, Dist[(c*ff)/f, Subst[Int[(a + b*(ff*x)^n)^p/(c^2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ
[{a, b, c, e, f, n, p}, x] && (IntegersQ[n, p] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rule 2074

Int[(P_)^(p_)*(Q_)^(q_.), x_Symbol] :> With[{PP = Factor[P]}, Int[ExpandIntegrand[PP^p*Q^q, x], x] /;  !SumQ[N
onfreeFactors[PP, x]]] /; FreeQ[q, x] && PolyQ[P, x] && PolyQ[Q, x] && IntegerQ[p] && NeQ[P, x]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

\begin{align*} \int \frac{1}{1+\tan ^3(x)} \, dx &=\operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right ) \left (1+x^3\right )} \, dx,x,\tan (x)\right )\\ &=\operatorname{Subst}\left (\int \left (\frac{1}{6 (1+x)}+\frac{1+x}{2 \left (1+x^2\right )}+\frac{1-2 x}{3 \left (1-x+x^2\right )}\right ) \, dx,x,\tan (x)\right )\\ &=\frac{1}{6} \log (1+\tan (x))+\frac{1}{3} \operatorname{Subst}\left (\int \frac{1-2 x}{1-x+x^2} \, dx,x,\tan (x)\right )+\frac{1}{2} \operatorname{Subst}\left (\int \frac{1+x}{1+x^2} \, dx,x,\tan (x)\right )\\ &=\frac{1}{6} \log (1+\tan (x))-\frac{1}{3} \log \left (1-\tan (x)+\tan ^2(x)\right )+\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (x)\right )+\frac{1}{2} \operatorname{Subst}\left (\int \frac{x}{1+x^2} \, dx,x,\tan (x)\right )\\ &=\frac{x}{2}-\frac{1}{2} \log (\cos (x))+\frac{1}{6} \log (1+\tan (x))-\frac{1}{3} \log \left (1-\tan (x)+\tan ^2(x)\right )\\ \end{align*}

Mathematica [C]  time = 0.0223794, size = 57, normalized size = 1.54 \[ -\frac{1}{3} \log \left (\tan ^2(x)-\tan (x)+1\right )+\left (\frac{1}{4}-\frac{i}{4}\right ) \log (-\tan (x)+i)+\left (\frac{1}{4}+\frac{i}{4}\right ) \log (\tan (x)+i)+\frac{1}{6} \log (\tan (x)+1) \]

Antiderivative was successfully verified.

[In]

Integrate[(1 + Tan[x]^3)^(-1),x]

[Out]

(1/4 - I/4)*Log[I - Tan[x]] + (1/4 + I/4)*Log[I + Tan[x]] + Log[1 + Tan[x]]/6 - Log[1 - Tan[x] + Tan[x]^2]/3

________________________________________________________________________________________

Maple [A]  time = 0.026, size = 34, normalized size = 0.9 \begin{align*} -{\frac{\ln \left ( 1-\tan \left ( x \right ) + \left ( \tan \left ( x \right ) \right ) ^{2} \right ) }{3}}+{\frac{\ln \left ( 1+\tan \left ( x \right ) \right ) }{6}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( x \right ) \right ) ^{2} \right ) }{4}}+{\frac{x}{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(1+tan(x)^3),x)

[Out]

-1/3*ln(1-tan(x)+tan(x)^2)+1/6*ln(1+tan(x))+1/4*ln(1+tan(x)^2)+1/2*x

________________________________________________________________________________________

Maxima [A]  time = 1.50686, size = 45, normalized size = 1.22 \begin{align*} \frac{1}{2} \, x - \frac{1}{3} \, \log \left (\tan \left (x\right )^{2} - \tan \left (x\right ) + 1\right ) + \frac{1}{4} \, \log \left (\tan \left (x\right )^{2} + 1\right ) + \frac{1}{6} \, \log \left (\tan \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+tan(x)^3),x, algorithm="maxima")

[Out]

1/2*x - 1/3*log(tan(x)^2 - tan(x) + 1) + 1/4*log(tan(x)^2 + 1) + 1/6*log(tan(x) + 1)

________________________________________________________________________________________

Fricas [A]  time = 1.38414, size = 149, normalized size = 4.03 \begin{align*} \frac{1}{2} \, x + \frac{1}{12} \, \log \left (\frac{\tan \left (x\right )^{2} + 2 \, \tan \left (x\right ) + 1}{\tan \left (x\right )^{2} + 1}\right ) - \frac{1}{3} \, \log \left (\frac{\tan \left (x\right )^{2} - \tan \left (x\right ) + 1}{\tan \left (x\right )^{2} + 1}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+tan(x)^3),x, algorithm="fricas")

[Out]

1/2*x + 1/12*log((tan(x)^2 + 2*tan(x) + 1)/(tan(x)^2 + 1)) - 1/3*log((tan(x)^2 - tan(x) + 1)/(tan(x)^2 + 1))

________________________________________________________________________________________

Sympy [A]  time = 0.200639, size = 34, normalized size = 0.92 \begin{align*} \frac{x}{2} + \frac{\log{\left (\tan{\left (x \right )} + 1 \right )}}{6} + \frac{\log{\left (\tan ^{2}{\left (x \right )} + 1 \right )}}{4} - \frac{\log{\left (\tan ^{2}{\left (x \right )} - \tan{\left (x \right )} + 1 \right )}}{3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+tan(x)**3),x)

[Out]

x/2 + log(tan(x) + 1)/6 + log(tan(x)**2 + 1)/4 - log(tan(x)**2 - tan(x) + 1)/3

________________________________________________________________________________________

Giac [A]  time = 1.09872, size = 46, normalized size = 1.24 \begin{align*} \frac{1}{2} \, x - \frac{1}{3} \, \log \left (\tan \left (x\right )^{2} - \tan \left (x\right ) + 1\right ) + \frac{1}{4} \, \log \left (\tan \left (x\right )^{2} + 1\right ) + \frac{1}{6} \, \log \left ({\left | \tan \left (x\right ) + 1 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+tan(x)^3),x, algorithm="giac")

[Out]

1/2*x - 1/3*log(tan(x)^2 - tan(x) + 1) + 1/4*log(tan(x)^2 + 1) + 1/6*log(abs(tan(x) + 1))